﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage/MasterPage.master" AutoEventWireup="true" CodeFile="SystemSetting.aspx.cs" Inherits="Manage_SystemSetting" %>
<%@ Register Src="~/Manage/CmsMessageBox.ascx" TagName="MessageBox" TagPrefix="cms" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <script type="text/javascript">
        $(document).ready(function () {
            $('#SearchBar').width($('#Body table.List').width());

            $('#<%=Save.ClientID %>').click(function () {
                var ds = [{ 'Controller': "input[id*='body_Settings_SettingValue']",
                    'Type': 'CR',
                    'ErrorMessage': '参数值设置错误。',
                    'Clear': false,
                    'Focus': true
                }];
                
                return Cms_ValidateForm(ds);
            });
        });
    </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="body" Runat="Server">
    <cms:MessageBox ID="MessageBox" runat="server" />
    <div id="SearchBar">
        <table cellpadding="0" cellspacing="0">
            <tr>
                <td><asp:Button ID="Save" runat="server" Text="保存" onclick="Save_Click"/></td>
            </tr>
        </table>
    </div>
    <div style="clear: both">
        <asp:Repeater ID="Settings" runat="server">
            <HeaderTemplate>
                <table class="List" cellspacing="1">
                    <tr class="header">
                        <th style="width:300px">描述</th>
                        <th>键值</th>                        
                    </tr>
            </HeaderTemplate>
            <AlternatingItemTemplate>
                <tr class="even">
                    <td style="width:300px" align="center"><%#Eval("Memo") %></td>
                    <td align="left">
                        <asp:TextBox ID="SettingValue" runat="server" Width="300px" Text='<%#Eval("Value") %>'></asp:TextBox>
                        <asp:HiddenField ID="SettingID" runat="server" Value='<%#Eval("ID") %>' />
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <ItemTemplate>
                <tr class="odd">
                    <td style="width:300px" align="center"><%#Eval("Memo") %></td>
                    <td align="left">
                        <asp:TextBox ID="SettingValue" runat="server" Width="300px" Text='<%#Eval("Value") %>'></asp:TextBox>
                        <asp:HiddenField ID="SettingID" runat="server" Value='<%#Eval("ID") %>' />
                    </td> 
                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </table>
            </FooterTemplate>
        </asp:Repeater>
    </div>
</asp:Content>